from pydantic import BaseModel
from typing import Optional

class GradeBase(BaseModel):
    name: str
    level: int

class GradeCreate(GradeBase):
    pass

class Grade(GradeBase):
    id: int
    
    class Config:
        from_attributes = True

class GradeWithRelations(Grade):
    knowledge_points: Optional[list] = []